const defaultState = {
    tags: [],
    loading: false
}

const reducer = (state = defaultState, action) => {
    switch (action.type) {
        case 'setTags':
            return {
                ...state,
                tags: action.tags
            }
        case 'setLoading':
            return {
                ...state,
                loading: action.loading
            }
        default:
            return state
    }
}

export default reducer